package com.kriss.blog.dao.impl;

import java.util.List;

import com.kriss.blog.common.BaseDaoImpl;
import com.kriss.blog.dao.IUserDao;
import com.kriss.blog.entity.User;

public class UserDaoImpl extends BaseDaoImpl<User> implements IUserDao {

	public User login(User user) {
		List ls = this.getHibernateTemplate().find("from User where username = ? and userpasss = ?", user.getUsername(),user.getUserpasss());
		User temp = null;
		
		if(ls!=null&&ls.size()==1){
			temp = (User)ls.get(0);
		}
		
		return temp;
	}

}
